package com.itheima.canal.util;


import com.alibaba.otter.canal.protocol.CanalEntry;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 将List集合转换为Map
 */
public class CanalUtil {

    public static Map convertToMap(List<CanalEntry.Column> columnList){
        Map map = new HashMap();

        if(columnList == null && columnList.size() >0){
            for (CanalEntry.Column column : columnList) {
                map.put(column.getName(),column.getValue());
            }
        }
        return map;
    }
}
